package cn.hinglo.gameclaw.admin.dao;

import cn.hinglo.gameclaw.data.dbdao.MyMapper;
import cn.hinglo.gameclaw.user.bean.Orders;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * @createTime: 2017/12/29
 * @author: HingLo
 * @description: 订单管理
 */
@Repository
public interface OrderDao extends MyMapper<Orders> {

    /**
     * 物流费用明细
     *
     * @param type 支付类型
     * @param date 时间
     * @return 结果
     */
    @Select("select id,user_id,mon,payment,date,pay_date from orders where mon>0 and  payment=#{type} and date_format(date,'%y-%m-%d') = date_format(#{date},'%y-%m-%d')")
    List<Map<String, Object>> orderDetailDao(@Param("type") int type, @Param("date") Date date);

}
